package com.liuyu.common.framework.rocketmq.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * rocketmq 主题属性
 *
 * @author: liuyu
 * @date: 2022/4/24 8:29
 * @version: 1
 */
@Component
@ConfigurationProperties(prefix = "rocketmq.topic")
@Data
public class RocketMqTopic {

    private boolean singleTopic = false;

    private boolean strict = false;
    /**
     * 主题map
     */
    private Map<String, String> topicMap = new HashMap<>();
    /**
     * 顺序主题
     */
    private Map<String, String> orderlyTopicMap = new HashMap<>();


    /**
     * 订单
     */
    public static String TOPIC_ORDERLY_ORDER = "order";

    /**
     * 订单回调
     */
    public static String TOPIC_ORDERLY_ORDER_CALLBACK = "orderCallback";

    /**
     * 订单延迟队列
     */
    public static String TOPIC_DELAY_ORDER = "orderDelay";

    /**
     * 预售订单
     */
    public static String TOPIC_ORDERLY_PRE_ORDER = "preOrder";
    /**
     * 支付订单
     */
    public static String TOPIC_ORDERLY_PAY_ORDER = "pay";

    /**
     * 支付订单延迟主题
     */
    public static String TOPIC_DELAY_PAY_ORDER = "payDelay";

    /**
     * 订单退款
     */
    public static String TOPIC_ORDERLY_REFUND_ORDER = "refundOrder";


    /**
     * 通用
     */
    public static String TOPIC_COMMON = "common";


    /**
     * api 请求
     */
    public static String TOPIC_API_REQUEST = "apiRequest";
    /**
     * api 响应
     */
    public static String TOPIC_API_RESPONSE = "apiResponse";

    /**
     * 证件校验持久化主题
     */
    public static String TOPIC_IDENTITY_PERSISTENT = "identityPersistent";

    /**
     * 医保校验持久化主题
     */
    public static String TOP_MEDICAL_IDENTITY_PERSISTENT = "medicalIdentityPersistent";

    /**
     * 证件查询主题
     */
    public static String TOPIC_IDENTITY_QUERY = "identityQuery";


    /**
     * 保司 请求
     */
    public static String TOPIC_INSURANCE_REQUEST = "insuranceRequest";
    /**
     * 保司 响应
     */
    public static String TOPIC_INSURANCE_RESPONSE = "insuranceResponse";

    /**
     * 惠民保转存
     */
    public static String TOPIC_HMB_ORDER = "hmbOrder";

}
